package com.itheima.manage.dao;

import com.itheima.manage.domain.Student;

public class StudentDao {
    private static Student[] students = new Student[5];
    public void addbich(Student stu,int index){
        students[index]=stu;
    }//添加
    public void remove(String id){
        for (int i = 0; i < students.length; i++) {
            if (students[i]!=null && students[i].getId().equals(id)){
                students[i]=null;
                System.out.println("以删除");
                break;
            }
        }
    }//删除
    public Student[] allarr(){
        return students;
    }//获取数组
    public void setting(int index,Student stu){
        students[index]=stu;
    }//修改
}
